package com.droid.faces;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

import com.droid.persistor.dao.Categoria;
import com.droid.persistor.facade.PersistorFacade;

//@FacesConverter(value="jogadorConverter")
public class CategoriaConverter implements Converter {

	
	 @Override
	 public Object getAsObject(FacesContext fc, UIComponent uic, String string) {
			PersistorFacade pFacade= new PersistorFacade();
			Categoria tgo = pFacade.getCategoria(string);
	 return tgo;
	 }

	 @Override
	 public String getAsString(FacesContext fc, UIComponent uic, Object o) {
		 Categoria cto = new Categoria();
		 cto= (Categoria) o;
		 return cto.getNombre();		 
	 }

	}